<?php if (!defined('THINK_PATH')) exit();?>﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/Admin/lib/html5shiv.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/skin/green/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="/Public/css/common.css" />
<!--[if IE 6]>
<script type="text/javascript" src="/Public/Admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>角色管理</title>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 
	<span class="c-gray en">&gt;</span> 权限管理 
	<span class="c-gray en">&gt;</span> 角色管理 
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
		<i class="Hui-iconfont">&#xe68f;</i>
	</a>
</nav>	
<div class="page-container">

	<div class="cl "> 
		<span class="l"> 
			<a class="btn btn-primary radius" href="javascript:;" onclick="admin_role_add('添加角色','<?php echo U(role_info);?>')"><i class="Hui-iconfont">&#xe600;</i> 添加角色</a> 
		</span> 
	</div>
	<?php if(empty($list)): echo ($empty); ?>
	<?php else: ?>
		<table class="table table-border table-bordered table-hover table-bg mt-10">
			<thead>
				<tr class="text-c">
					<th width="200">角色名</th>
					<th width="400">描述</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr class="text-c">
						<td><?php echo ($vo['name']); ?></td>
						<td><?php echo ($vo['remark']); ?></td>
						<td class="f-14">
							<a title="编辑" href="javascript:;" onclick="admin_role_edit('<?php echo ($vo[role_id]); ?>')" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i>编辑</a> 
							<a title="删除" href="javascript:;" onclick="admin_role_del('<?php echo ($vo[role_id]); ?>')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i>删除</a>
						</td>
					</tr><?php endforeach; endif; else: echo "$empty" ;endif; ?>
			</tbody>
		</table><?php endif; ?>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/Admin/static/h-ui.admin/js/H-ui.admin.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/My97DatePicker/4.8/WdatePicker.js"></script> 

<!-- <script type="text/javascript" src="/Public/Admin/lib/picker/distpicker.data.js"></script> -->
<!-- <script type="text/javascript" src="/Public/Admin/lib/picker/distpicker.js"></script> -->


<script type="text/javascript" src="/Public/js/common.js"></script>
<script type="text/javascript" src="/Public/js/md5.js"></script>

<!--/_footer 作为公共模版分离出去-->

<script type="text/javascript">
/*管理员-角色-添加*/
function admin_role_add(title,url){
	var index = layer.open({
		content:url,
		type:2,
		title:title
	});
	layer.full(index)
}
/*管理员-角色-编辑*/
function admin_role_edit(id){
	var url = "/admin/admin/role_info?role_id="+id;
	var index = layer.open({
		content:url,
		type:2,
		title:'编辑管理员角色'
	});
	layer.full(index)
}
var index;
/*管理员-角色-删除*/
function admin_role_del(id){
	layer.confirm('角色删除须谨慎，确认要删除吗？',function(index){
		$.ajax({
			type: 'get',
			url: '/admin/admin/del_role?role_id='+id,
			beforeSend:function(){
				index = layer.load(1)
			},
			success: function(data){
				var json = JSON.parse(data);
				if(json.status == 1)
				{
	                layer.msg(json.message,{
	                    icon:1,
	                    time:2000
	                },function(){
	                    location.reload();
	                })
	            }
	            else
	            {
	                layer.alert(json.message,{icon:2});
	            }
			},
			error:function() {
				layer.alert('网络错误，请重试（del_role）',{icon:2});
			},
			complete:function(){
				layer.close(index)
			}
		});		
	});
}

</script>
</body>
</html>